package com.lanou3g.zjl.chating.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import butterknife.ButterKnife;

/**
 * Created by dllo on 15/11/17.
 */
public abstract class BaseFragment extends Fragment {

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        //加载布局
        View view = getLayout(inflater);
        //初始化依赖注入
        ButterKnife.bind(this,view);
        //初始化数据
        initData();

        return view;

    }

    /**
     * 返回值为所要加载的布局文件
     * @return
     */
    protected abstract View getLayout(LayoutInflater inflater);
    
    //初始化数据
    protected abstract void initData();
}
